<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


<p:panel id="pmEstadoPanel" style="border: none;">
	<h:panelGrid columns="1">
		<h:outputText value="Código: *" />
		<p:inputText id="pmEstadoId" value="#{beanEstado.estado.id}" size="4"
			maxlength="4" disabled="true" />
		<h:outputText value="Estado: *" />
		<p:inputText id="pmEstadoEstado" value="#{beanEstado.estado.estado}"
			size="40" maxlength="40" />
		<h:outputText value="Sigla: *" />
		<p:inputText id="pmEstadoSigla" value="#{beanEstado.estado.sigla}"
			size="4" maxlength="3" mask="aaa" />
	</h:panelGrid>
	<h:panelGrid columns="2">
		<h:outputText value="Código: * &nbsp; &nbsp;" />
		<h:outputText value="País:* " />
	</h:panelGrid>
	<h:panelGrid columns="3">
		<p:inputText id="pmEstadoIdPais" value="#{beanEstado.estado.pais.id}"
			size="4">
			<p:ajax event="change" listener="#{beanEstado.hotFind}"
				update="pmEstadoPais" process="@this" />
		</p:inputText>
		<p:inputText id="pmEstadoPais" value="#{beanEstado.estado.pais.pais}"
			size="40" disabled="true" binding="#{beanEstado.nomePais}" />

		<p:commandButton id="pmEstadoSelesctPais" icon="ui-icon-search"
			title="Selecionar Pais" onclick="dConsultaPais.show()" type="button">
		</p:commandButton>
	</h:panelGrid>
	<h:panelGrid columns="3">
		<p:commandButton id="pmEstadoSalvar" value="Salvar"
			action="#{beanEstado.save}" oncomplete="dManterEstado.hide()"
			update="pmEstadoPanel, :form:pcEstadoPanel" />
		<p:commandButton id="pmEstadoLimpar" value="Limpar" type="reset" />
		<p:commandButton id="pmEstadoVoltar" value="Voltar"
			onclick="dManterEstado.hide()" />
	</h:panelGrid>
</p:panel>

<p:dialog header="Consultar Pais" widgetVar="dConsultaPais"
	id="pmEstadoConsPais" resizable="false">
	<ui:include src="/pais/popConsultaPais.xhtml"></ui:include>
</p:dialog>

</html>